import request from '@/config/axios'

// 用户-题库-记录 VO
export interface UserBankRecordVO {
  id: number // 主键
  bankId: number // 题库ID
  userBankId: number // 用户题库ID
  userId: number // 持有者
  bizType: string // 题库操作类型
  bizId: string // 关联的业务ID
  bizData: string // 业务数据
}

// 用户-题库-记录 API
export const UserBankRecordApi = {
  // 查询用户-题库-记录分页
  getUserBankRecordPage: async (params: any) => {
    return await request.get({ url: `/exam/user-bank-record/page`, params })
  },

  // 查询用户-题库-记录详情
  getUserBankRecord: async (id: number) => {
    return await request.get({ url: `/exam/user-bank-record/get?id=` + id })
  },

  // 新增用户-题库-记录
  createUserBankRecord: async (data: UserBankRecordVO) => {
    return await request.post({ url: `/exam/user-bank-record/create`, data })
  },

  // 修改用户-题库-记录
  updateUserBankRecord: async (data: UserBankRecordVO) => {
    return await request.put({ url: `/exam/user-bank-record/update`, data })
  },

  // 删除用户-题库-记录
  deleteUserBankRecord: async (id: number) => {
    return await request.delete({ url: `/exam/user-bank-record/delete?id=` + id })
  },

  // 导出用户-题库-记录 Excel
  exportUserBankRecord: async (params) => {
    return await request.download({ url: `/exam/user-bank-record/export-excel`, params })
  }
}